package com.ware.controller.admin;


import com.ware.controller.BaseController;
import com.ware.dao.ComIntroduce;
import com.ware.util.AjaxResult;

public class ComIntroduceController extends BaseController {
	
	public void info(){
		render("introduce.ftl");
	}

	public void edit(){
		AjaxResult result = new AjaxResult(1);
		
		try {
			ComIntroduce cn = this.getModel(ComIntroduce.class, "comIntro");
			if (cn.get("id", "").equals("")) {
				cn.save();
				result.setData("id", cn.get("id"));
			} else {
				cn.update();
			}
		} catch (Exception e) {
			e.printStackTrace();
			result.addError(e.getMessage());
		}
		this.renderJson(result.toJson());
	}
}
